#include "CustomListWidgetItem.h"

CustomListWidgetItem::CustomListWidgetItem(const QString& text, int lineNumber) : 
	QListWidgetItem(text), m_lineNumber(lineNumber) {}

bool CustomListWidgetItem::operator<(const QListWidgetItem& other) const
{
	const CustomListWidgetItem* customOtherItem = dynamic_cast<const CustomListWidgetItem*>(&other);
	if (customOtherItem)
	{
		return m_lineNumber < customOtherItem->lineNumber();
	}

	return QListWidgetItem::operator<(other);
}

int CustomListWidgetItem::lineNumber() const { return m_lineNumber; }
